package com.gsnd.briuppts.web.controller;

import com.gsnd.briuppts.entity.Student;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController  //定义此处进行web的功能
@RequestMapping("/test") //url
public class HelloController {
    //纯文字
    @RequestMapping ("/1")
    public String test1(){
        return "你好";
    }
    //对象
    @RequestMapping ("/2")
    public Student test2(){
        Student student=new Student();
        student.setId(1);
        student.setName("张三");
        return student;
    }
    //集合
    @RequestMapping ("/3")
    public List<Integer> test3(){
        List<Integer> list=new ArrayList<>();
        list.add(4);
        list.add(2);
        list.add(6);
        return list;
    }
}
